/**
 * ReportGear(2011)
 */
package net.abbp.report.designer.components.resume.panel;

import java.awt.Dimension;
import java.awt.GridBagLayout;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

import net.abbp.swing.layout.LayoutUtils;

import com.reportgear.core.swing.pane.base.JBasePane;

/**
 * 新建简历模板
 * 
 * @version 1.0 2011-4-17
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class NewResumeTemplatePanel extends JBasePane {
    private static final long serialVersionUID = 5458250149417829383L;
    private JTextField txtName;

    public NewResumeTemplatePanel() {
        this.initComponents();
    }

    // 输入是否有效
    public boolean isInputValid() {
        if ("".equals(this.getName())) {
            return false;
        } else {
            return true;
        }
    }

    public String getName() {
        return this.txtName.getText().trim();
    }

    private void initComponents() {
        this.setLayout(new GridBagLayout());

        this.add(new JLabel("模板名称", SwingConstants.LEFT), LayoutUtils.newGridBagConstraints(0, 0, 1, 1));
        this.txtName = new JTextField();
        this.txtName.setPreferredSize(new Dimension(300, 24));
        this.add(this.txtName, LayoutUtils.newGridBagConstraints(1, 0, 1, 1));
    }
}
